package com.easybuy.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.easybuy.dao.GoodsTypeDao;
import com.easybuy.entity.GoodsType;
import com.easybuy.service.GoodsTypeService;

@Service("goodsTypeService")
public class GoodsTypeServiceImpl implements GoodsTypeService {

	@Autowired
	private GoodsTypeDao goodsTypeDao;

	public List<GoodsType> getList(String name, int level, int first,
			int maxResult) {
		return goodsTypeDao.getList(name, level, first, maxResult);
	}

	public int getCount(String name, int level) {
		return goodsTypeDao.getCount(name, level);
	}

	public void add(GoodsType goodsType) {
		goodsTypeDao.add(goodsType);
	}

	public List<GoodsType> getByParentId(int parentId) {
		return goodsTypeDao.getByParentId(parentId);
	}
}
